package com.db;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@MapperScan(basePackages = {"com.db.user.mapper","com.db.product.mapper","com.db.area.mapper","com.db.industry.mapper","com.db.tenant.mapper","com.db.deviceType.mapper","com.db.device.mapper","com.db.pck.mapper"})
public class QfIotManagerApiApplication {

    public static void main(String[] args) {
        SpringApplication.run(QfIotManagerApiApplication.class, args);
    }

    /*添加mybatis-plus分页拦截器*/
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return mybatisPlusInterceptor;
    }

}
